package com.gather.spring.retry.aop;

import java.lang.annotation.*;

/**
 * @author kxd
 * @date 2018/12/5 10:23
 * description:注解aop实现 retry功能
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.CLASS)
@Documented
public @interface Retryable {
    /**
     * exception type that are retryable
     * @return exception type to retry
     */
    Class<? extends Throwable> value() default  RuntimeException.class;

    /**
     * 包含第一次失败的重试次数
     * @return
     */
    int maxAttempts() default 3;
}
